package controller;

import dao.GetName;
import dao.Speech;
import dao.attend;
import dao.hr;

import java.util.Scanner;

public class homeImpl implements home{
    public void userhome() {
        boolean f=true;
        do {
            System.out.println("--------考勤管理系统--------");
            System.out.println("            1.叫号");
            System.out.println("            0.退出系统");
            Scanner sc = new Scanner(System.in);
            int n = sc.nextInt();
            switch (n) {
                case 1: {
                    System.out.println("您选择了： 1.叫号");
                    String text=GetName.selectById();
                    Speech.textToSpeech(text);
                    System.out.println("--------考勤管理系统1--------");
                    System.out.println("            2.出勤");
                    System.out.println("            3.缺勤");
                    System.out.println("            4.请假");
                    int a=sc.nextInt();
                    if(a==2){
                        attend.attendance(text);
                    }
                    if(a==3){
                        attend.absence(text);
                    }
                    if(a==4){
                        attend.leave(text);
                    }
                    userhome();
                    break;
                }
                case 0: {
                    attend.show();
                    System.out.println("已退出系统！");
                    f=false;

                    break;
                }
            }
        }while (f);
    }

}



